<template>
    <div>
        <van-nav-bar
            left-text="意见反馈"
            left-arrow
            @click-left="onClickLeft"
            style="background-color: #4fc08d;"

        />
        <div class="main">
            <h5>请留下你的宝贵意见</h5>
            <div class="yijian">
                <textarea placeholder="请输入你的宝贵意见" class="textarea" v-model="inputtext"></textarea>
                <van-button  size="small" @click="onClickSubmit(inputtext)" round type="success">提交</van-button>
            </div>

  
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { showToast,Toast  } from "vant";

import { useRouter } from "vue-router";

let $router = useRouter()

const inputtext = ref("")


// 提交
function onClickSubmit(inputtext:any) {
    console.log(inputtext);
    
    if (inputtext == "") {
        console.log(1);
        
        showToast({
             message:"请输入你的宝贵意见",
        }
        )
    }else{
        console.log(2);
        showToast({
             message:"提交成功",
        }
        )
        $router.push('/Mine')

    }

}

// 返回
function onClickLeft() {
  $router.back();
}

</script>

<style scoped>
h5{
    text-align: center;
    line-height: 30px;
}
.yijian{
    width: 100%;
    height: 500px;
}
.textarea{
    width: 300px;
    height: 300px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 37px;
    font-size:12px;
}
.van-button{
    width:300px;
    margin:5px 37px;
    font-size:12px;
}
</style>